/****************************************************************************************
 * @file    SCCB.h
 *
 * @author  Shanon
 *
 * @version V1.0.0
 *
 * @date    2016/09/12
 *
 * @brief   SCCB header file.
 ***************************************************************************************/
#ifndef __SCCB_H
#define __SCCB_H

#include "stm32f4xx.h"

#define I2C_PAGESIZE	4


/* Maximum Timeout values for flags and events waiting loops. These timeouts are
   not based on accurate values, they just guarantee that the application will 
   not remain stuck if the I2C communication is corrupted.
   You may modify these timeout values depending on CPU frequency and application
   conditions (interrupts routines ...). */   
#define SCCB_Open_FLAG_TIMEOUT         10000
#define OV7670_DEVICE_WRITE_ADDRESS    0x42
#define OV7670_DEVICE_READ_ADDRESS     0x43

#define SCCB_SPEED               100000
#define SCCB_SLAVE_ADDRESS7      0xFE

/* DCMI Communication boards Interface. Configure I2C2 pins: PB10 -> SIOC and PB11 -> SIOD */
#define Open_SCCB                        	I2C2
#define Open_SCCB_CLK                    	RCC_APB1Periph_I2C2

#define Open_SCCB_SDA_PIN                 	GPIO_Pin_10
#define Open_SCCB_SDA_GPIO_PORT           	GPIOB
#define Open_SCCB_SDA_GPIO_CLK            	RCC_AHB1Periph_GPIOB
#define Open_SCCB_SDA_SOURCE              	GPIO_PinSource10
#define Open_SCCB_SDA_AF                  	GPIO_AF_I2C2

#define Open_SCCB_SCL_PIN                 	GPIO_Pin_11
#define Open_SCCB_SCL_GPIO_PORT           	GPIOB
#define Open_SCCB_SCL_GPIO_CLK            	RCC_AHB1Periph_GPIOB
#define Open_SCCB_SCL_SOURCE              	GPIO_PinSource11
#define Open_SCCB_SCL_AF                  	GPIO_AF_I2C2

void SCCB_GPIO_Config( void );

uint8_t DCMI_SingleRandomWrite(uint8_t Addr, uint8_t Data);

uint8_t DCMI_SingleRandomRead(uint8_t Addr, uint8_t *Data);

#endif 


